﻿using System;
using System.IO;
using System.Net;
using log4net;
using Quartz;
using Spider.Util;

namespace Spider.ScheduledTask
{
    public class AliveJob : IJob
    {
        public void Execute(IJobExecutionContext context)
        {
            WebClient client = new WebClient();
            try
            {
                Uri uri = new Uri("http://localhost:8888/Stock/Reflush");
                Stream stream=client.OpenRead(uri);
                stream.Close();
            }
            catch (Exception e)
            {
                Logger.Error(e.StackTrace.ToString());
            }
            finally
            {
                client.Dispose();
            }
        }
    }
}
